package com.csc.bankingsystem.core.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.aspectj.bridge.Message;

import com.csc.bankingsystem.core.enumeration.HistoryRecordActionEnum;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;

/**
 * HistoryRecord Data Transfer Object
 * 
 * @author angelkid
 *
 */
@Entity
@Table(name = "HISTORYRECORD")
public class HistoryRecord extends BankingSystemAbstractEntity {
	private Date startTime;
	private HistoryRecordActionEnum action;
	private UserInfo userInfo;
	private String message;

	@Column(name = "startTime", nullable = false, length = 12)
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "action", nullable = false)
	@Enumerated(EnumType.STRING)
	public HistoryRecordActionEnum getAction() {
		return action;
	}

	public void setAction(HistoryRecordActionEnum action) {
		this.action = action;
	}

	@Column(name = "message", nullable = true, length = 500)
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@JsonManagedReference
	@ManyToOne
	@JoinColumn(name = "userInfoId")
	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

}
